import Vue from 'vue'
import Router from 'vue-router'
import home from '@/views/home'
import productDetails from '@/views/product-details'
import productList from '@/views/product-list'
import about from '@/views/about'
import news from '@/views/news'
import product from '@/views/product'
import yanfa from '@/views/yanfa'
import zannue from '@/views/zannue'
import lianxi from '@/views/lianxi'
import newsDetails from '@/views/news-details'
import school from '@/views/zannue/school'
import society from '@/views/zannue/society'
import zpDetails from '@/views/zannue/zp-details'
import licheng from '@/views/about/licheng'
import chanye from '@/views/about/chanye'
import jianjie from '@/views/about/jianjie'
import wenhua from '@/views/about/wenhua'
import chanyeDetails from '@/views/chanye-details'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: home
    },
    {
      path: '/productDetails/:id',
      name: 'productDetails',
      component: productDetails
    },
    {
      path: '/about',
      name: 'about',
      redirect: '/jianjie',
      component: about,
      children: [
        {
          path: '/jianjie',
          name: 'jianjie',
          component: jianjie
        },
        {
          path: '/licheng',
          name: 'licheng',
          component: licheng
        },
        {
          path: '/chanye',
          name: 'chanye',
          component: chanye
        },
        {
          path: '/wenhua',
          name: 'wenhua',
          component: wenhua
        }
      ]
    },
    {
      path: '/news',
      name: 'news',
      component: news
    },
    {
      path: '/product',
      name: 'product',
      component: product
    },
    {
      path: '/yanfa',
      name: 'yanfa',
      component: yanfa
    },
    {
      path: '/zannue',
      name: 'zannue',
      redirect: '/society',
      component: zannue,
      children: [
        {
          path: '/school',
          name: 'school',
          component: school
        },
        {
          path: '/society',
          name: 'society',
          component: society
        }
      ]
    },
    {
      path: '/lianxi',
      name: 'lianxi',
      component: lianxi
    },
    {
      path: '/newsDetails/:id',
      name: 'newsDetails',
      component: newsDetails
    },
    {
      path: '/zpDetails/:id',
      name: 'zpDetails',
      component: zpDetails
    },
    {
      path: '/productList/:id/:name',
      name: 'productList',
      component: productList
    },
    {
      path: '/chanyeDetails/:id',
      name: 'chanyeDetails',
      component: chanyeDetails
    }
  ]
})
